﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ABT
{
    public partial class Admin_Search : Form
    {
        public Admin_Search()
        {
            InitializeComponent();
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void Search(string query)
        {
            SqlConnection connect = new SqlConnection();
            SqlCommand cmd = new SqlCommand();
            DataTable tbl = new DataTable();
            connect.ConnectionString = @"Data Source=.\SQLEXPRESS;AttachDbFilename=C:\USERS\AHMEDQ\DOCUMENTS\VISUAL STUDIO 2010\PROJECTS\ABT\ABT\DATABASE1.MDF;Integrated Security=True;User Instance=True";
            cmd.Connection = connect;
            cmd.CommandText = "Select * From  Where ='" +  + "'and ='" +  + "'";
            cmd.CommandText = query;
            try
            {
                connect.Open();
                tbl.Load(cmd.ExcuteReader());
                dgv.DataSource = tbl;
                connect.Close();
            }
            catch (SqlExeption ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Search("select * from  where ");
        }

        private void Admin_Search_Load(object sender, EventArgs e)
        {
            Search("Select * from where like'%"+textBox1.Text+"%' or ");
        }
    }
}
